// 先找到body
var body = document.querySelector('body');
// 创建一个div
var div = document.createElement('div');
// 把div添加到body
body.appendChild(div);
// 对div进行样式描述:
div.style.width = '100vw';
div.style.display = 'flex';
// 通过ID找到div，创建两个main
div.setAttribute('id','header');
var div1 = document.getElementById('header')
var main1 = document.createElement('main');
var main2 = document.createElement('main');
// 把main添加到.header
div.appendChild(main1);
div.appendChild(main2);
// 给两个main设置id
main1.setAttribute('id','left');
main2.setAttribute('id','right');

left.style.backgroundImage = 'url(http://n.sinaimg.cn/sinacn/20170426/3492-fyepses8257103.jpg)'
left.style.backgroundSize = '100% 100%';
left.style.width = '40vw';
// 块元素right：
// 在块元素right里创建6个img，
right.style.width = '60vw';
var img =document.createElement('img');
var img1 =document.createElement('img');
var img2 =document.createElement('img');
var img3 =document.createElement('img');
var img4 =document.createElement('img');
var img5 =document.createElement('img');
right.appendChild(img);
right.appendChild(img1);
right.appendChild(img2);
right.appendChild(img3);
right.appendChild(img4);
right.appendChild(img5);
// 给各个img添加src：
img.setAttribute('src','http://n.sinaimg.cn/sinacn/20170426/f981-fyepsch3415645.jpg');
img1.setAttribute('src','http://n.sinaimg.cn/sinacn/20170426/3849-fyepsch3415651.jpg');
img2.setAttribute('src','http://n.sinaimg.cn/sinacn/20170426/c041-fyepses8257105.jpg');
img3.setAttribute('src','http://n.sinaimg.cn/sinacn/20170426/c041-fyepses8257105.jpg');
img4.setAttribute('src','http://n.sinaimg.cn/sinacn/20170426/5264-fyepsec1173291.jpg');
img5.setAttribute('src','http://n.sinaimg.cn/ent/transform/20170424/Zmmn-fyepsec0812671.jpg');
// 给块元素right设置弹性布局
img.style.width = '20vw';
img1.style.width = '20vw';
img2.style.width = '20vw';
img3.style.width = '20vw';
img4.style.width = '20vw';
img5.style.width = '20vw';


